package util

import "fmt"

func GetSql(tag []string, name, suffix string) string {
	SqlCmd := `select `
	for _, s := range tag {

		SqlCmd += fmt.Sprintf("last(%s) %s, ", s, s)
	}
	SqlCmd += fmt.Sprintf(name, suffix)
	return SqlCmd
}
